﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Main.aspx.cs" MasterPageFile="~/Pages/Master/Main.Master" Inherits="SysCall_FINAL.Pages.Main.Main" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <fieldset id="pageLoad">
        <div id="fillInData">
           <h1>Meus chamados</h1>

           <fieldset id="filter">
           <legend>Filtrar por</legend>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AllowPaging="True"
                CellPadding="4" Font-Size="Small" ForeColor="#333333" GridLines="None" 
                Font-Names="Courier New" Width="100%"
                   DataSourceID="odsCallsByUserLoggedIn">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Id" 
                    HeaderText="ID" SortExpression="Id" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="5%" />
                </asp:BoundField>
<%--                <asp:BoundField DataField="ProblemDescription" HeaderText="Problema" 
                    SortExpression="ProblemDescription" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="SolutionDescription" 
                    HeaderText="Solução" SortExpression="SolutionDescription" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:BoundField>--%>
                <asp:BoundField DataField="DateOpening" HeaderText="Data de Abertura" 
                    SortExpression="DateOpening" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="7.5%" />
                </asp:BoundField>
                <asp:BoundField DataField="DateClosing" HeaderText="Data de Encerramento" 
                    SortExpression="DateClosing" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="7.5%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Categoria" SortExpression="CallSubCategory">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CallSubCategory") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CallSubCategory.CallCategory.Description") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Subcategoria" SortExpression="CallSubCategory">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("CallSubCategory") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("CallSubCategory.Description") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Atendente" SortExpression="UserClose">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("UserFinish") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("UserFinish.Name") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Unidade" SortExpression="Sector">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Sector.Unit") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Sector.Unit.Name") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Setor" SortExpression="Sector">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Sector") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("Sector.Description") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Status" SortExpression="CallStatus">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("CallStatus") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("CallStatus.Description") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>

                             
               <asp:ObjectDataSource ID="odsCallsByUserLoggedIn" runat="server" 
                   SelectMethod="GetCallByUser" 
                   TypeName="br.com.SistemaChamados.Controller.CallController">
                   <SelectParameters>
                       <asp:SessionParameter DefaultValue="0" Name="userOpenId" 
                           SessionField="ID_USER_LOGGED_IN_SESSION" Type="Int32" />
                       <asp:Parameter Name="callId" Type="Int32" />
                       <asp:Parameter Name="dateOpening" Type="String" />
                       <asp:Parameter Name="problemDescription" Type="String" />
                       <asp:Parameter Name="categoryId" Type="Int32" />
                       <asp:Parameter Name="subCategoryId" Type="Int32" />
                       <asp:Parameter Name="statusId" Type="Int32" />
                   </SelectParameters>
               </asp:ObjectDataSource>
                             
           </fieldset>

        </div>
        </fieldset>
   </asp:Content>
